include ../../Makefile.inc

SOURCES := $(wildcard [^_]*.cc)
OBJECTS := $(foreach file,$(SOURCES),$(subst .cc,.o,$(file)))
BINARY := fbundler
LIBDIR := ../../goesele-proj/mve/libs
EXTDIR := ../../goesele-proj/mve/extern


EXT_INCL := -I${LIBDIR} -I${EXTDIR}
EXT_LIBS := -L${LIBDIR}/util -L${LIBDIR}/mve -lX11 -lmve -lutil -lpng -ljpeg -ltiff

all: ${OBJECTS} lib
	${CXX} -o ${BINARY} ${OBJECTS} ${EXT_LIBS}

%.o: %.cc
	${CXX} -c -o $@ $< -Wall -Wextra -Wundef -ansi -O3 -g ${EXT_INCL}

lib:
	${MAKE} -C ../../libs/mve

depend:
	${CXX} -MM ${SOURCES} ${EXT_INCL} > Makefile.dep

clean: FORCE
	${RM} ${OBJECTS} ${BINARY} ${TESTBIN}

FORCE:

include Makefile.dep
